<?php

class UserPic extends CWidget
{

    public $model;
    public $size;
    public $htmlOptions;

    public function init()
    {
	
    }

    public function run()
    {
	$size = $this->size ? $this->size : 20;
	$src = Yii::app()->params['defaultAvatar'][$size];
	if ($model) {
	    $src = $model->getUserPic($this->size);
	}
	echo CHtml::image($src, '', $this->htmlOptions);
    }
    
}

?>
